package com.xjj.datarources.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xjj.datarources.pojo.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @name: xjj
 * @date: 2021/5/25 15:46
 */
@Mapper
public interface RoleMapper extends BaseMapper<SysRole> {


    @Select("select r.* from sys_role r inner JOIN sys_user_role ur on r.id = ur.role_id LEFT JOIN user_info u on u.id = ur.uid WHERE u.id = #{id}")
    List<SysRole> getRole(@Param("id") Integer uid);

}
